package com.gxa.core.recycling.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "menu")   //创建数据表注解
@Entity   //ORM 对象关系映射的关键主键
public class Menu implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @Column(name = "pid")
    @JsonIgnore
    //副id
    private Long pid;

    @Column(name = "name")
    //权限名称
    private String name;

    @Column(name = "url")
    private String url;

    private List<Menu> menus = new ArrayList<>();

}
